﻿using MySql.Data.MySqlClient;
using NB.MGJ.FrameWork;
using NB.MGJ.Model;
using NB.MGJ.Model.AntiFake;
using NB.MGJ.Model.CodeManage;
using NB.MGJ.Model.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NB.MGJ.Service.AntiFake
{
    public class QuerycatchService
    {
        public BaseRepository _base = new BaseRepository();

        #region  execl导出
        public IEnumerable<CodeLog> GetAllQuerycatch(string Search, string code)
        {
            var resule = string.Format("SELECT * FROM nblogmain.CodeLog{0}", code);
            if (!string.IsNullOrWhiteSpace(Search))
            {
                resule += " where Fw_Code like '%" + Search + "%' and Valid=0 ";
            }
            else {
                resule += " where  Valid=0 ";
            }
            return _base.ExecuteSqlCollection<CodeLog>(resule);
        }
        #endregion
     
    }

}